package com.jiyinit.web.core.business.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.jiyinit.core.framework.base.util.Check;
import com.jiyinit.web.core.business.entity.TabCoreTaskMessage;
import com.jiyinit.web.core.common.config.PropertyPlaceholderConfigurer;
import com.jiyinit.web.core.common.util.CustomDateSerialize;

import java.util.Date;
import java.util.List;

/**
 * Created by lr on 2018/1/19.
 */
public class DailyLogListVo {

    private Integer taskId;
    private Date createTime;
    private String userName;
    private Integer isRead;
    private List<TabCoreTaskMessage> message;
    private String avatar;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getIsRead() {
        return isRead;
    }

    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }

    public Integer getTaskId() {
        return taskId;
    }

    public void setTaskId(Integer taskId) {
        this.taskId = taskId;
    }
    @JsonSerialize(using = CustomDateSerialize.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public List<TabCoreTaskMessage> getMessage() {
        return message;
    }

    public void setMessage(List<TabCoreTaskMessage> message) {
        this.message = message;
    }

    public String getAvatar() {
        if(!Check.isNullStr(avatar))
        {
            String picPath = (String) PropertyPlaceholderConfigurer.getContextProperty("USER_AVATAR");
            return picPath+avatar;
        }
        else
        {
            return "";
        }
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
}
